<template>
    <div>
        <el-card>

            <el-row style="padding-top: 15px;">
                <el-row>
                    <el-col :span="7">
                        <span>搜索：</span>
                        <el-input v-model="student" placeholder="请输入学生姓名搜索" style="width: 180px;" size="mini"
                            clearable></el-input>
                        <el-button type="primary" el-icon-plus size="mini" @click="getCurrentPageData()">
                            查询</el-button>
                    </el-col>
                    <el-row style="margin-top: 2%;">
                        <el-table :data="tableData" stripe style="margin-top: 20px;" border>
                            <el-table-column prop="id" label="序号">
                            </el-table-column>
                            <el-table-column prop="name" label="意向学员">
                            </el-table-column>
                            <el-table-column prop="clue" label="线索">
                            </el-table-column>
                            <el-table-column prop="teacher" label="录入人">
                            </el-table-column>
                            <el-table-column prop="createTime" label="创建时间">
                            </el-table-column>
                            <el-table-column label="编辑" width="180">
                                <template slot-scope="scope">
                                    <el-link :underline="false" type="primary" style="font-size: 12px"
                                        @click="detail(scope.row.id)">删除</el-link>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                </el-row>
            </el-row>
        </el-card>

    </div>
</template>

<script>
export default {
    data() {
        return {
            student:'',
            tableData: [],
        };
    },
    methods: {
       

        getCurrentPageData: function () {
            // 页面加载时需要将当前页、页大小作为参数传给后台  key=value 传值
            //  /money/tenement?page=1&size=10
            let data = {
                name: this.student,
            }
            this.$axios.post("/prospectiveStudent/findByClue", data).then(res => {
                console.log(res.data)
                this.tableData = res.data.data
            
            })
        },
        detail: function (id) {
         
            this.$axios.delete("/prospectiveStudent/delClue/"+id).then(res => {
             if(res.data.data == true){
                this.$message.success("删除成功")
                    this.getCurrentPageData()
             }
            })
        }

    },
    mounted() {
        this.getCurrentPageData()
    },
};
</script>



<style scoped></style>


<style scoped></style>